#ifndef ADDPROCESS_H
#define ADDPROCESS_H


#include "LogicProcess.h"
#include "Time.h"
#include <vector>
#include <ctime>
#include <sstream>
class AddProcess:public LogicProcess {
private:
	vector<string> startKeyWord;
	vector<string> endKeyWord;
	
	string daySeparator;
	string hourSeparator;
	/*static vector<string> dayName;
	static vector<string> monthName;
	*/

	string task;
	Time startTime;
	Time endTime;
	Time currentTime;

	Time getCurrentTime();
	string getLastWord(string& str);


	bool isDayPhrase(string phrase,Time& dayPhrase);
	bool isHourPhrase(string phrase,Time& hourPhrase);
	bool isDaySeparator(char testChar);
	bool isHourSeparator(char testChar);
	bool isStartKeyWord(string word);
	bool isEndKeyWord(string word);
	bool isDayName(string name);
	bool isMonthName(string name);

	void backupToUndo(Task task);

	//return the integer if str is an positive integer
	//return -1 is not
	int isPositiveInteger(string str);
public:
	AddProcess(string command,allTaskList *givenLists,allCommandStack *givenStacks);
	AddProcess(Task task,TaskList *list);
	~AddProcess();
	Task getFullTask();
	void solveContent();
	void HandleProcesss();
	void quickProcess(Task task);
	
	Time lastTimePhrase();

	string getTask();
	Time getStartTime();
	Time getEndTime();
	string toString();

	int cvtToNumber(string tmp){return 0;}
};
#endif
